Socket
Socket
Sign inDemoInstall

@wixc3/patterns

Package Overview
Dependencies
Maintainers
68
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wixc3/patterns

A utility for saving objects to be disposed


Version published
Maintainers
68
Created
Source

npm version @wixc3/patterns on Github

Home > @wixc3/patterns

patterns package

Useful data structures such as LRU-Cache, set-multi-map, Signal, EventEmitter, Disposable, Debouncer

Classes

ClassDescription
DebouncerCancelable debouncing of calls to trigger
Disposable_2
Disposables
EventEmitterBasic type safe event emitter
LRUCacheBASIC (not optimal) implementation of the LRU cache
SafeDisposable

Adds dispose-safe methods to Disposables:

- setInterval/setTimeout - guard

SetMultiMapMaps keys to a set of values
SignalSignal is a simple event emitter for one type of event.

Functions

FunctionDescription
createDisposables(name, initialGroups)

Disposables allow adding of disposal async functions, when dispose is called, these functions will be run sequentially

Disposal groups: You can set disposal groups with constraints (before, after) to ensure that disposal groups are disposed in the correct order

within each group disposables are disposed in the reverse order they were added

isDisposable(value)
isSetMultiMap(x)

Interfaces

InterfaceDescription
DisposalGroup
IDisposable
LRUCacheConfig

Variables

VariableDescription
DEFAULT_GROUP
DEFAULT_TIMEOUT

Type Aliases

Type AliasDescription
DisposableItem
DisposableOptions
GroupConstraints
IEventEmitter
Listener

FAQs

Package last updated on 11 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc